import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/education/train_plan/training_result_department_list_entity.dart';

TrainingResultDepartmentListEntity $TrainingResultDepartmentListEntityFromJson(Map<String, dynamic> json) {
  final TrainingResultDepartmentListEntity trainingResultDepartmentListEntity = TrainingResultDepartmentListEntity();
  final int? averageScore = jsonConvert.convert<int>(json['averageScore']);
  if (averageScore != null) {
    trainingResultDepartmentListEntity.averageScore = averageScore;
  }
  final int? classHour = jsonConvert.convert<int>(json['classHour']);
  if (classHour != null) {
    trainingResultDepartmentListEntity.classHour = classHour;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    trainingResultDepartmentListEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    trainingResultDepartmentListEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    trainingResultDepartmentListEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    trainingResultDepartmentListEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    trainingResultDepartmentListEntity.deleted = deleted;
  }
  final String? departmentName = jsonConvert.convert<String>(json['departmentName']);
  if (departmentName != null) {
    trainingResultDepartmentListEntity.departmentName = departmentName;
  }
  final int? finishHours = jsonConvert.convert<int>(json['finishHours']);
  if (finishHours != null) {
    trainingResultDepartmentListEntity.finishHours = finishHours;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    trainingResultDepartmentListEntity.id = id;
  }
  final String? planId = jsonConvert.convert<String>(json['planId']);
  if (planId != null) {
    trainingResultDepartmentListEntity.planId = planId;
  }
  final int? qualifiedTextbookCount = jsonConvert.convert<int>(json['qualifiedTextbookCount']);
  if (qualifiedTextbookCount != null) {
    trainingResultDepartmentListEntity.qualifiedTextbookCount = qualifiedTextbookCount;
  }
  final int? score = jsonConvert.convert<int>(json['score']);
  if (score != null) {
    trainingResultDepartmentListEntity.score = score;
  }
  final int? totalScore = jsonConvert.convert<int>(json['totalScore']);
  if (totalScore != null) {
    trainingResultDepartmentListEntity.totalScore = totalScore;
  }
  final int? textbookCount = jsonConvert.convert<int>(json['textbookCount']);
  if (textbookCount != null) {
    trainingResultDepartmentListEntity.textbookCount = textbookCount;
  }
  final int? trainingHours = jsonConvert.convert<int>(json['trainingHours']);
  if (trainingHours != null) {
    trainingResultDepartmentListEntity.trainingHours = trainingHours;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    trainingResultDepartmentListEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    trainingResultDepartmentListEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    trainingResultDepartmentListEntity.updateDate = updateDate;
  }
  final String? userDepartmentId = jsonConvert.convert<String>(json['userDepartmentId']);
  if (userDepartmentId != null) {
    trainingResultDepartmentListEntity.userDepartmentId = userDepartmentId;
  }
  final String? userDepartmentName = jsonConvert.convert<String>(json['userDepartmentName']);
  if (userDepartmentName != null) {
    trainingResultDepartmentListEntity.userDepartmentName = userDepartmentName;
  }
  final String? userId = jsonConvert.convert<String>(json['userId']);
  if (userId != null) {
    trainingResultDepartmentListEntity.userId = userId;
  }
  final String? userName = jsonConvert.convert<String>(json['userName']);
  if (userName != null) {
    trainingResultDepartmentListEntity.userName = userName;
  }
  return trainingResultDepartmentListEntity;
}

Map<String, dynamic> $TrainingResultDepartmentListEntityToJson(TrainingResultDepartmentListEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['averageScore'] = entity.averageScore;
  data['classHour'] = entity.classHour;
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['departmentName'] = entity.departmentName;
  data['finishHours'] = entity.finishHours;
  data['id'] = entity.id;
  data['planId'] = entity.planId;
  data['qualifiedTextbookCount'] = entity.qualifiedTextbookCount;
  data['score'] = entity.score;
  data['totalScore'] = entity.totalScore;
  data['textbookCount'] = entity.textbookCount;
  data['trainingHours'] = entity.trainingHours;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  data['userDepartmentId'] = entity.userDepartmentId;
  data['userDepartmentName'] = entity.userDepartmentName;
  data['userId'] = entity.userId;
  data['userName'] = entity.userName;
  return data;
}

extension TrainingResultDepartmentListEntityExtension on TrainingResultDepartmentListEntity {
  TrainingResultDepartmentListEntity copyWith({
    int? averageScore,
    int? classHour,
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    String? departmentName,
    int? finishHours,
    String? id,
    String? planId,
    int? qualifiedTextbookCount,
    int? score,
    int? totalScore,
    int? textbookCount,
    int? trainingHours,
    String? updateBy,
    String? updateById,
    String? updateDate,
    String? userDepartmentId,
    String? userDepartmentName,
    String? userId,
    String? userName,
  }) {
    return TrainingResultDepartmentListEntity()
      ..averageScore = averageScore ?? this.averageScore
      ..classHour = classHour ?? this.classHour
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..departmentName = departmentName ?? this.departmentName
      ..finishHours = finishHours ?? this.finishHours
      ..id = id ?? this.id
      ..planId = planId ?? this.planId
      ..qualifiedTextbookCount = qualifiedTextbookCount ?? this.qualifiedTextbookCount
      ..score = score ?? this.score
      ..totalScore = totalScore ?? this.totalScore
      ..textbookCount = textbookCount ?? this.textbookCount
      ..trainingHours = trainingHours ?? this.trainingHours
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate
      ..userDepartmentId = userDepartmentId ?? this.userDepartmentId
      ..userDepartmentName = userDepartmentName ?? this.userDepartmentName
      ..userId = userId ?? this.userId
      ..userName = userName ?? this.userName;
  }
}
